package com.heima.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.admin.mapper.ApAuthMapper;
import com.heima.admin.service.IApAuthService;
import com.heima.api.user.IUserClient;

import com.heima.model.article.dtos.AuthDto;
import com.heima.model.article.pojos.ApAuthor;
import com.heima.model.common.dtos.ResponseResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@RequiredArgsConstructor
public class ApAuthServiceImpl extends ServiceImpl<ApAuthMapper, ApAuthor> implements IApAuthService {
    private final ApAuthMapper apAuthMapper;
    private final IUserClient userClient;


    /**
     * 审核分页列表查询
     * @param authDto
     * @return
     */
    @Override
    public ResponseResult authList(AuthDto authDto) {
        //需要根据状态分页查询，状态在user微服务当中
        ResponseResult result = userClient.auth(authDto);
        return result;
    }

    /**
     * 审核失败
     * @param authDto
     * @return
     */
    @Override
    public ResponseResult authFail(AuthDto authDto) {
        return userClient.authFail(authDto);
    }


    /**
     * 审核成功
     * @param authDto
     * @return
     */
    @Override
    public ResponseResult authPass(AuthDto authDto) {
        return userClient.authPass(authDto);
    }
}
